package com.marvels.approve.mqueues.service;

import java.util.List;

import com.marvels.approve.mqueues.dto.LoanApplyQueueDTO;
import com.marvels.common.exception.MarvelsBusinessException;

/**进件详情queue同步跟踪服务
 * @author 何杰
 * 2018年5月9日
 */
public interface ApproveILoanApplyQueueService {
	
	/**进件详情queue同步跟踪入库
	 * @author 何杰
	 * 2018年5月9日
	 * @param loanApplyQueue
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyQueueDTO saveLoanApplyQueueService(LoanApplyQueueDTO loanApplyQueue)throws MarvelsBusinessException;
	
	/**进件详情queue同步跟踪变更
	 * @author 何杰
	 * 2018年5月9日
	 * @param loanApplyQueue
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyQueueDTO editLoanApplyQueueService(LoanApplyQueueDTO loanApplyQueue)throws MarvelsBusinessException;
	
	/**进件详情queue同步跟踪查询
	 * @author 何杰
	 * 2018年5月9日
	 * @param loanApplyQueue
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public List<LoanApplyQueueDTO> findLoanApplyQueueService(LoanApplyQueueDTO loanApplyQueue)throws MarvelsBusinessException;
	
	/**通过ID查询进件详情queue同步跟踪
	 * @author 何杰
	 * 2018年5月9日
	 * @param id
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyQueueDTO findLoanApplyQueueService(Long id)throws MarvelsBusinessException;
	
	/**待跑决策
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public Integer findLoanApplyQueueCount()throws MarvelsBusinessException;
	/**保存
	 * @author 何杰
	 * 2018年5月10日
	 */
	public LoanApplyQueueDTO processQueue(String loanId)throws MarvelsBusinessException;
	/**处理逻辑
	 * @author 何杰
	 * 2018年5月9日
	 * @param loanId
	 * @throws Exception
	 */
	public void processItem(LoanApplyQueueDTO loanApplyQueue)throws MarvelsBusinessException;
	
	/**
	 * 处理超过5分钟还没有改变状态的单
	 * wanggang
	 * @param loanApplyQueue
	 * @return
	 */
	public List<LoanApplyQueueDTO> selectExpiredLoanApplyQueue(LoanApplyQueueDTO loanApplyQueue);
	
	/**通过ID查询进件详情queue同步跟踪
	 * @author 何杰
	 * 2018年5月9日
	 * @param id
	 * @return
	 * @throws MarvelsBusinessException
	 */
	public LoanApplyQueueDTO findLoanApplyQueueLoanId(String loanId)throws MarvelsBusinessException;
}
